from math import *

if __name__ == '__main__':
    end = 1
    count = 0
    while True:
        triangularNum = sum(i for i in range(1, end))
        for j in range(1, int(sqrt(triangularNum)) + 1):  # sqrt(triangularNum))必定有一个因数小于其平方根
            if triangularNum % j == 0:
                count += 1
        end += 1
        if 2 * count > 500:  # 因数成对出现，只需要查找一半即可
            print(triangularNum)
            break
        count = 0
